<template>
  <div>
    <h2>子组件</h2>
  </div>
</template>

<script setup>
import { onUnmounted } from 'vue'

const timer = setTimeout(() => {
  console.log('子组件挂载了')
}, 1000)

onUnmounted(() => {
  clearTimeout(timer)
  console.log('子组件卸载了')
})
</script>

<style lang="scss" scoped></style>
